Fix xentrace_format to deal with more than 16 CPUs.
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Fri, 19 May 2006 14:52:35 +0000 (15:52 +0100)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Fri, 19 May 2006 14:52:35 +0000 (15:52 +0100)
Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
tools/xentrace/xentrace_format

index 827680b95e964b3bf4896e95c48101009b20c129..537785824acafe1b5e16ffbfac4a05c9746643f7 100644 (file)
@@ -89,7 +89,7 @@ defs = read_defs(arg[0])
 CPUREC = "I"
 TRCREC = "QLLLLLL"
 
-last_tsc = [0,0,0,0,0,0,0,0]
+last_tsc = [0]
 
 i=0
 
@@ -111,7 +111,9 @@ while not interrupted:
 
        #print i, tsc
 
-       if tsc < last_tsc[cpu]:
+        if cpu >= len(last_tsc):
+            last_tsc += [0] * (cpu - len(last_tsc) + 1)
+       elif tsc < last_tsc[cpu]:
            print "TSC stepped backward cpu %d !  %d %d" % (cpu,tsc,last_tsc[cpu])
 
        last_tsc[cpu] = tsc